package com.chance.cc.crawler.prod.command.trigger.domain.vm.xcar.trace;

import com.chance.cc.crawler.core.CrawlerJob;
import com.chance.cc.crawler.core.downloader.HttpPage;
import com.chance.cc.crawler.meta.core.bean.CrawlerMetaConstant;
import com.chance.cc.crawler.prod.command.job.domain.vm.xcar.trace.XcarForumTopicTraceCrawlerScheduleJob;
import com.chance.cc.crawler.prod.command.trigger.CommonCrawlerSchedulerTrigger;

/**
 * @author bx
 * @date 2020/12/7 0007 11:15
 */
public class XcarForumTopicTraceScheduleTrigger extends CommonCrawlerSchedulerTrigger {

    public static void main(String[] args) {
        CrawlerJob crawlerJob = XcarForumTopicTraceCrawlerScheduleJob.xcarCwalerJob();
        publishXcarNewsScheduleTriggerInfo(crawlerJob.generateCrawlerKey(),crawlerJob.generateCrawlerTriggerKey());
    }

    public static void publishXcarNewsScheduleTriggerInfo(String crawlerKey,String crawlerTriggerKey){
        HttpPage page = metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerKey,
                crawlerTriggerKey,
                XcarForumTopicTraceCrawlerScheduleJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 10 3 * * ?",
                "爱卡汽车论坛发帖每天3：10采集一次");
        System.out.println("添加采集调度： "+page.getRawText());
    }
}
